package com;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * @author zsj
 * @version 1.0
 * @date 2024/5/26 20:44
 * @description
 */
public class JumpCount {
    public static volatile AtomicInteger count = new AtomicInteger(1);

    public static void main(String[] args) {
        while (count.get() <= 300) {
            try {
                TimeUnit.SECONDS.sleep(1);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println(count.getAndIncrement());
        }
        System.out.println("结束一组了");
    }
}
